<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="../myTaoBaoCSS/myTaoBao.css" />
		<!--<script src="../js/jquery-1.9.1.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/area.js" type="text/javascript" charset="utf-8"></script>-->
		<title></title>
		<style type="text/css">
			.dqld_div {
				width: 100%;
				background-color: #fff;
				position: absolute;
				top: 2.8rem;
			}
			
			.dqld_div ul {
				width: 90%;
			}
			
			.dqld_div ul li {
				height: 35px;
				line-height: 35px;
				border-bottom: 1px solid #cccccc;
				padding-left: 10px;
				font-size: 0.3rem;
			}
			
			.address_input1 {
				border: none;
				outline: none;
				padding: 0.3rem 0;
			}
			
			.address_input {
				margin-left: 0.4rem;
			}
		</style>
	</head>

	<body>

		<ul class="nav_SZ" style="border-bottom: 1px solid #ccc;">
			<li>
				<a href="sheZ.html">
					<</a>
			</li>
			<li>管理收货地址</li>
			<li></li>
		</ul>

		<div class="chengs">
			<div id="addAddress">
				<div class="address_input">
					<input class="address_input1" type="text" placeholder="请选择省市" id="shengshi" onClick="getProvinceBuy()" readonly="readonly" value="">
				</div>
			</div>
		</div>

		<div class="dIz_A">

			<input type="text" placeholder="请输入详细地址" value="">
			<span></span>
		</div>

		<div class="dIz_b">

			<input type="text" placeholder="请输入收货人地址" value="">
			<span></span>
		</div>
		<div class="dIz_q">

			<input type="text" placeholder="请输入收货人" value="">
			<span></span>
		</div>
		<div class="dIz_c">

			<input type="text" placeholder="请输入收货人联系电话" value="" class="sj">
			<span id="Boss8" style="color: blue;">请输入手机号</span>
		</div>

		<!--<div class="dIz_e">
				<input type="text" placeholder="请输入邮编" value="">
				<span style="color: blue;">请输入邮编</span>
			</div>-->

		<div class="mims">
			<input type="button" value="保存地址" onclick="arr()" />
		</div>
	</body>
	<script src="../js/jquery-1.9.1.js" type="text/javascript" charset="utf-8"></script>
	<script src="../js/area.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		document.documentElement.style.fontSize = innerWidth / 16 + "px";
		//				console.log("1rem="+innerWidth/16)
		onresize = function() {
			document.documentElement.style.fontSize = innerWidth / 16 + "px";
		};
		var reg1 = /^[1]\d{10}$/;
		$(".sj").blur(function() {

			if(reg1.test($(".sj").val())) {
				$("#Boss8").html("输入正确");
				$("#Boss8").css("color", "black");

			} else {
				$("#Boss8").html("输入错误");
				$("#Boss8").css("color", "red");
			}
		});

		function arr() {
			//			 newa=$(".address_input1").val();
			//			 console.log(newa)
			phone1 = localStorage.getItem("phone1");
			$.ajax({
				type: "post",
				url: "http://47.92.37.168/supermarket/data/user_update_addr.php",
				async: true,
				data: {
					user_addr: $(".address_input1").val() + "-" + $(".dIz_A input").val() + "-" + $(".dIz_b input").val() + "-" + $(".dIz_c input").val() + "-" + $(".dIz_q input").val(),
					user_phone: phone1
				},
				dataType: "jsonp",
				jsonp: "callback",
				success: function(data) {
					//						console.log(data)
					//							debugger
					//							localStorage.setItem("use_addr",$(".dIz_e input").val());
					localStorage.setItem("name", $(".dIz_q input").val());
					localStorage.setItem("phone", $(".dIz_c input").val());
					localStorage.setItem("addr", $(".address_input input").val() + $(".dIz_b input").val());
					localStorage.setItem("use_addr", $(".dIz_e input").val());
					location.href = "gliYmian.html";

				}
			});

		}

		var reg1 = /^[1]\d{10}$/;
		$(".sj").blur(function() {

			if(reg1.test($(".sj").val())) {
				$("#Boss8").html("输入正确");
				$("#Boss8").css("color", "black");

			} else {
				$("#Boss8").html("输入错误");
				$("#Boss8").css("color", "red");
			}
		});
	</script>

</html>